%%%-------------------------------------------------------------------
%%% @author Rain
%%% @doc 生成proto结构
%%% @end
%%%-------------------------------------------------------------------
-author("Rain").
-ifndef(BUILD_PROTO_HRL).
-define(BUILD_PROTO_HRL, true).

-define(PROTO_PATH, "./src/proto/").
-define(PROTO_VERSION_2, "2").
-define(PROTO_VERSION_3, "3").

-record(build_proto_msg, {
    cmd_sub_id = 0 :: integer(), % 子协议号
    name = "" :: string(), % 消息名称
    desc = "" :: string(), % 消息描述
    c2s :: [_|_] | undefined, % c2s消息 [{"field_name", "field_type_with_desc"} | ...]
    s2c :: [_|_] | undefined % s2c消息 [{"field_name", "field_type_with_desc"} | ...]
}).

-record(build_proto_struct, {
    name = "" :: string(), % 结构名称
    desc = "" :: string(), % 结构描述
    fields :: [_|_] | undefined % 结构字段 [{"field_name", "field_type_with_desc"} | ...]
}).

-record(build_proto, {
    proto_name = "" :: string(), % proto名称
    cmd_main_id = 0 :: integer(), % 主协议号
    messages = [] :: [#build_proto_msg{}], % 消息列表
    imports = [] :: [string()], % 导入的proto文件列表
    structs = [] :: [#build_proto_struct{}] % 结构体列表
}).




-endif.